<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * group.php
 * @author ranuandra
 *
 * 12 Sep 2011 08:35:02
 *
 * 
 */
?>
Ext.BLANK_IMAGE_URL = '<?php echo URL::base()?>assets/resources/images/default/s.gif';

Ext.onReady(function() {
	Ext.QuickTips.init();

    var loginDialog = new Ext.ux.form.LoginDialog({
        modal : true,
		url: '<?php echo URL::base()?>home/login',
        //forgotPasswordLink : 'http://www.microsoft.com/protect/yourself/password/create.mspx',
        cancelButton: 'Close',
        basePath: 'shared/icons',
        listeners: {
        	success:function(form, action){ 
        		if(action.result.success == "true")
        		{
	            	Ext.Msg.alert('Status', action.result.message, function(btn, text){
				    if (btn == 'ok'){
			                    var redirect = '<?php echo URL::base()?>main'; 
			                    window.location = redirect;
			                       }
			        });        		
        		}
        		else
        		{
        			Ext.Msg.alert('Error', action.result.message);
			        Ext.getCmp(this._loginButtonId).enable();
			        if(Ext.getCmp(this._cancelButtonId)) {
			            Ext.getCmp(this._cancelButtonId).enable();
			        }
        			return false;
        		}

		    }
        }
    });
    
    loginDialog.show();

});